package com.study.sbsummary.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 文章合集表
 * </p>
 *
 * @author DaiDaiMei
 * @since 2022-02-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class DocCollection implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 自增
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 合集id，实际还是docid的形式
     */
    private String collectionId;

    /**
     * 作者userid
     */
    private Long userid;

    /**
     * 日期
     */
    private LocalDate date;

    /**
     * 状态：0正常，1删除 2注销账号 3违规封号
     */
    private Integer status;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 内容
     */
    private String content;

    /**
     * 点赞数
     */
    private Integer likeCount;

    /**
     * 评论数
     */
    private Integer commentCount;

    /**
     * 分享数
     */
    private Integer shareCount;

    /**
     * 收藏数
     */
    private Integer collectCount;

    /**
     * 类型
     */
    private String ctype;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 合集下文章更新的时间
     */
    private LocalDateTime docUpdateTime;

    /**
     * 普通发文=1；新人礼导入发文=2；活动=3
     */
    private Integer docType;

    public enum Column {
        id("id"),
        collectionId("collection_id"),
        userid("userid"),
        date("date"),
        status("status"),
        createTime("create_time"),
        content("content"),
        likeCount("like_count"),
        commentCount("comment_count"),
        shareCount("share_count"),
        collectCount("collect_count"),
        ctype("ctype"),
        updateTime("update_time"),
        docUpdateTime("doc_update_time"),
        docType("doc_type");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table doc_collection
         *
         * @mbg.generated
         * @project https://github.com/itfsw/mybatis-generator-plugin
         */
        private final String column;

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table doc_collection
         *
         * @mbg.generated
         * @project https://github.com/itfsw/mybatis-generator-plugin
         */
        public String value() {
            return this.column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table doc_collection
         *
         * @mbg.generated
         * @project https://github.com/itfsw/mybatis-generator-plugin
         */
        public String getValue() {
            return this.column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table doc_collection
         *
         * @mbg.generated
         * @project https://github.com/itfsw/mybatis-generator-plugin
         */
        Column(String column) {
            this.column = column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table doc_collection
         *
         * @mbg.generated
         * @project https://github.com/itfsw/mybatis-generator-plugin
         */
        public String desc() {
            return this.column + " DESC";
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table doc_collection
         *
         * @mbg.generated
         * @project https://github.com/itfsw/mybatis-generator-plugin
         */
        public String asc() {
            return this.column + " ASC";
        }
    }
}
